Optimal. Leaf size=161 \[ -\frac {\left (\frac {1}{2}-\frac {i}{2}\right ) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d}+\frac {1}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {5 \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {7 i \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.27, antiderivative size = 161, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3640, 3679, 12,
3625, 211} \begin {gather*} -\frac {5 \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {1}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}+\frac {7 i \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}-\frac {\left (\frac {1}{2}-\frac {i}{2}\right ) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 211
Rule 3625
Rule 3640
Rule 3679
Rubi steps
\begin {align*} \int \frac {1}{\tan ^{\frac {5}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}} \, dx &=\frac {1}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}+\frac {\int \frac {\sqrt {a+i a \tan (c+d x)} \left (\frac {5 a}{2}-2 i a \tan (c+d x)\right )}{\tan ^{\frac {5}{2}}(c+d x)} \, dx}{a^2}\\ &=\frac {1}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {5 \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {2 \int \frac {\sqrt {a+i a \tan (c+d x)} \left (-\frac {7 i a^2}{4}-\frac {5}{2} a^2 \tan (c+d x)\right )}{\tan ^{\frac {3}{2}}(c+d x)} \, dx}{3 a^3}\\ &=\frac {1}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {5 \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {7 i \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}+\frac {4 \int -\frac {3 a^3 \sqrt {a+i a \tan (c+d x)}}{8 \sqrt {\tan (c+d x)}} \, dx}{3 a^4}\\ &=\frac {1}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {5 \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {7 i \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}-\frac {\int \frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {\tan (c+d x)}} \, dx}{2 a}\\ &=\frac {1}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {5 \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {7 i \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}+\frac {(i a) \text {Subst}\left (\int \frac {1}{-i a-2 a^2 x^2} \, dx,x,\frac {\sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}\\ &=-\frac {\left (\frac {1}{2}-\frac {i}{2}\right ) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d}+\frac {1}{d \tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}}-\frac {5 \sqrt {a+i a \tan (c+d x)}}{3 a d \tan ^{\frac {3}{2}}(c+d x)}+\frac {7 i \sqrt {a+i a \tan (c+d x)}}{3 a d \sqrt {\tan (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.85, size = 159, normalized size = 0.99 \begin {gather*} \frac {i \left (3-18 e^{2 i (c+d x)}+7 e^{4 i (c+d x)}+3 e^{i (c+d x)} \left (-1+e^{2 i (c+d x)}\right )^{3/2} \tanh ^{-1}\left (\frac {e^{i (c+d x)}}{\sqrt {-1+e^{2 i (c+d x)}}}\right )\right )}{3 \sqrt {2} d \sqrt {\frac {a e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}} \left (-1+e^{4 i (c+d x)}\right ) \sqrt {\tan (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 400 vs. \(2 (128 ) = 256\).
time = 0.21, size = 401, normalized size = 2.49
method | result | size |
derivativedivides | \(\frac {\sqrt {a \left (1+i \tan \left (d x +c \right )\right )}\, \left (3 i \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{4}\left (d x +c \right )\right )+36 \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (\tan ^{2}\left (d x +c \right )\right )-3 i \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{2}\left (d x +c \right )\right )+28 i \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (\tan ^{3}\left (d x +c \right )\right )+6 \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{3}\left (d x +c \right )\right )+8 \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}\right )}{12 d a \tan \left (d x +c \right )^{\frac {3}{2}} \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}\, \left (-\tan \left (d x +c \right )+i\right )^{2}}\) | \(401\) |
default | \(\frac {\sqrt {a \left (1+i \tan \left (d x +c \right )\right )}\, \left (3 i \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{4}\left (d x +c \right )\right )+36 \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (\tan ^{2}\left (d x +c \right )\right )-3 i \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{2}\left (d x +c \right )\right )+28 i \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (\tan ^{3}\left (d x +c \right )\right )+6 \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{3}\left (d x +c \right )\right )+8 \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}\right )}{12 d a \tan \left (d x +c \right )^{\frac {3}{2}} \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \sqrt {-i a}\, \left (-\tan \left (d x +c \right )+i\right )^{2}}\) | \(401\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 403 vs. \(2 (119) = 238\).
time = 0.40, size = 403, normalized size = 2.50 \begin {gather*} -\frac {2 \, \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} {\left (7 \, e^{\left (6 i \, d x + 6 i \, c\right )} - 11 \, e^{\left (4 i \, d x + 4 i \, c\right )} - 15 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 3\right )} + 3 \, {\left (a d e^{\left (5 i \, d x + 5 i \, c\right )} - 2 \, a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {-\frac {2 i}{a d^{2}}} \log \left (\frac {1}{4} \, a d \sqrt {-\frac {2 i}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} + \frac {1}{4} \, \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} {\left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}\right ) - 3 \, {\left (a d e^{\left (5 i \, d x + 5 i \, c\right )} - 2 \, a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {-\frac {2 i}{a d^{2}}} \log \left (-\frac {1}{4} \, a d \sqrt {-\frac {2 i}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} + \frac {1}{4} \, \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} {\left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}\right )}{12 \, {\left (a d e^{\left (5 i \, d x + 5 i \, c\right )} - 2 \, a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \tan ^{\frac {5}{2}}{\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 529 vs. \(2 (119) = 238\).
time = 1.57, size = 529, normalized size = 3.29 \begin {gather*} \frac {\sqrt {-2 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )} a + 2 \, a^{2}} \sqrt {i \, a \tan \left (d x + c\right ) + a} {\left (\frac {\tan \left (d x + c\right )}{\sqrt {\frac {{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{2} - 2 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )} a + a^{2}}{a^{2}}}} + 1\right )} {\left (\frac {2 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )}}{a^{2} d} - \frac {3}{a d}\right )} {\left | a \right |}}{3 \, a^{2} \tan \left (d x + c\right )^{2}} - \frac {{\left (-i \, a \sqrt {{\left | a \right |}} + {\left | a \right |}^{\frac {3}{2}}\right )} \log \left (-\frac {-i \, {\left (\frac {\sqrt {2} \sqrt {i \, a \tan \left (d x + c\right ) + a} {\left (-\frac {i \, {\left | a \right |}}{a} + 1\right )} {\left | a \right |}^{\frac {3}{2}}}{a^{2}} - \frac {\sqrt {-2 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )} a + 2 \, a^{2}} {\left (\frac {\tan \left (d x + c\right )}{\sqrt {\frac {{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{2} - 2 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )} a + a^{2}}{a^{2}}}} + 1\right )} {\left | a \right |}}{a^{2}}\right )}^{2} + 8 \, \sqrt {2} + 12}{2 \, {\left (\frac {1}{2} i \, {\left (\frac {\sqrt {2} \sqrt {i \, a \tan \left (d x + c\right ) + a} {\left (-\frac {i \, {\left | a \right |}}{a} + 1\right )} {\left | a \right |}^{\frac {3}{2}}}{a^{2}} - \frac {\sqrt {-2 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )} a + 2 \, a^{2}} {\left (\frac {\tan \left (d x + c\right )}{\sqrt {\frac {{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{2} - 2 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )} a + a^{2}}{a^{2}}}} + 1\right )} {\left | a \right |}}{a^{2}}\right )}^{2} + 4 \, \sqrt {2} - 6\right )}}\right )}{4 \, a^{2} d} + \frac {4 \, \sqrt {2} {\left (a \sqrt {{\left | a \right |}} + i \, {\left | a \right |}^{\frac {3}{2}}\right )}}{{\left ({\left (\frac {\sqrt {2} \sqrt {i \, a \tan \left (d x + c\right ) + a} {\left (-\frac {i \, {\left | a \right |}}{a} + 1\right )} {\left | a \right |}^{\frac {3}{2}}}{a^{2}} - \frac {\sqrt {-2 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )} a + 2 \, a^{2}} {\left (\frac {\tan \left (d x + c\right )}{\sqrt {\frac {{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{2} - 2 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )} a + a^{2}}{a^{2}}}} + 1\right )} {\left | a \right |}}{a^{2}}\right )}^{2} - 4 i\right )} a^{2} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {1}{{\mathrm {tan}\left (c+d\,x\right )}^{5/2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________